Skip to content

Conversation

@evelyn-ys
Copy link
Member

@evelyn-ys evelyn-ys commented Mar 21, 2022

Description

In #16814, we have granted write access to azcopy installation directory.

But the scope stat.S_IWUSR | stat.S_IWGRP | stat.S_IWOTH is larger than necessary. Changed the scope to stat.S_IWUSR only.


This checklist is used to make sure that common guidelines for a pull request are followed.

@ghost ghost added the Auto-Assign Auto assign by bot label Mar 21, 2022
@ghost ghost requested a review from yonzhan March 21, 2022 09:45
@ghost ghost assigned evelyn-ys Mar 21, 2022
@ghost ghost added this to the Mar 2022 (2022-04-06) milestone Mar 21, 2022
@ghost ghost added the Storage az storage label Mar 21, 2022
@evelyn-ys evelyn-ys requested a review from jiasli March 21, 2022 09:46
@yonzhan
Copy link
Collaborator

yonzhan commented Mar 21, 2022

Storage

@evelyn-ys evelyn-ys merged commit 21cf639 into Azure:dev Mar 29, 2022
try:
os.chmod(install_dir,
os.stat(install_dir).st_mode | stat.S_IWUSR | stat.S_IWGRP | stat.S_IWOTH)
os.chmod(install_dir, os.stat(install_dir).st_mode | stat.S_IWUSR)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It seems stat.S_IWUSR is set by default:

import os
import stat
install_dir = 'temp'
os.makedirs(install_dir)
print(bool(os.stat(install_dir).st_mode & stat.S_IWUSR))

Output:

True

stat.S_IWUSR is not explicitly set when downloading bicep CLI:

installation_dir = os.path.dirname(installation_path)
if not os.path.exists(installation_dir):
os.makedirs(installation_dir)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Auto-Assign Auto assign by bot Storage az storage

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants